﻿using Coldairarrow.Entity.Base_Manage;
using Coldairarrow.Entity.PB;
using Coldairarrow.Util;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Coldairarrow.Business.PB
{
    public partial interface IPB_UserWagesBusiness
    {
        Task<PageResult<PB_UserWages>> GetDataListAsync(PageInput<ConditionDTO> input);
        Task<PB_UserWages> GetTheDataAsync(string id);
        Task AddDataAsync(PB_UserWages data);
        Task UpdateDataAsync(PB_UserWages data);
        Task DeleteDataAsync(List<string> ids);
        /// <summary>
        /// 验证工资是否有结算数据
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task<int> CheckUserWageDataAsync(WagesDTO data);
        /// <summary>
        /// 计算工资计件(按车间)
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task UpUserWagesForNumAsync(WagesDTO data);

        /// <summary>
        /// 计算工资计重(按车间)
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task UpUserWagesForWeightAsync(WagesDTO data);

        /// <summary>
        /// 计算工资喷涂(按车间)
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task UpUserWagesForPaintingAsync(WagesDTO data);

        /// <summary>
        /// 计算工资劳务(按日结)
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task UpUserWagesForLabourServicesByDayAsync(WagesDTO data);

        /// <summary>
        /// 计算工资劳务(按月结)
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task UpUserWagesForLabourServicesByMonthAsync(WagesDTO data);

        /// <summary>
        /// 计算工资劳务（单笔结算）
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task UpUserWagesForLabourServicesBySingleSettlementAsync(WagesDTO data);

        /// <summary>
        /// 工资(天)
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<UserWagesListDTO> GetUserWagesAsync(WagesConditionDTO input);

        /// <summary>
        /// 获取工序信息
        /// </summary>
        /// <returns></returns>
        Task<List<PB_ProcecureSub>> GetProcecureSubAsync();

        Task<List<PB_ProcecureSub>> GetProcecureSubList();
        /// <summary>
        /// 获取班别信息
        /// </summary>
        /// <param name="DeptId">车间Id</param>
        /// <returns></returns>
        Task<List<PB_ShiftType>> GetShiftTypeAsync(string DeptId);

        /// <summary>
        /// 获取登录人所属工厂下的车间信息
        /// </summary>
        /// <param name="deptId">工厂Id</param>
        /// <returns></returns>
        Task<List<Base_Department>> GetWorkShopAsync(string deptId);
        Task<List<Base_Department>> GetBumenAsync(string deptid);

        /// <summary>
        /// 获取登录人所属工厂
        /// </summary>
        /// <returns></returns>
        Task<List<Base_Department>> GetFactoryAsync();

        /// <summary>
        /// 获取工资详细
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<List<PB_UserWagesDTO>> GetExportUserWagesAsync(WagesConditionDTO input);

    }

    public class UserWagesListDTO
    {
        /// <summary>
        /// 总条数
        /// </summary>
        public int? Count { get; set; }

        /// <summary>
        /// 总金额
        /// </summary>
        public Double? Total { get; set; }

        /// <summary>
        /// 客户发货统计(明细)
        /// </summary>
        public List<PB_UserWagesDTO> UserWages { get; set; }

        /// <summary>
        /// 客户发货统计(明细)
        /// </summary>
        public List<PB_UserWagesMonthDTO> UserWagesMonth { get; set; }
    }

    public class WagesDTO
    {
        /// <summary>
        /// 开始日期
        /// </summary>
        public string StartDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        public string EndDate { get; set; }

        /// <summary>
        /// 车间
        /// </summary>
        public string DeptId { get; set; }

        /// <summary>
        /// 月结总重
        /// </summary>
        public string WeightTotal { get; set; }

        /// <summary>
        /// 月结单价
        /// </summary>
        public string Price { get; set; }

    }

    /// <summary>
    /// 工资(天)
    /// </summary>
    public class PB_UserWagesDTO
    {
        
        /// <summary>
        /// 序号
        /// </summary>
        public int? Rnumber { get; set; }

        /// <summary>
        /// 工厂Id
        /// </summary>
        public string FactoryId { get; set; }

        /// <summary>
        /// 工厂名称
        /// </summary>
        public string FactoryName { get; set; }

        /// <summary>
        /// 部门Id
        /// </summary>
        public string DeptId { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        public string DeptName { get; set; }

        /// <summary>
        /// 员工Id
        /// </summary>
        public string UserId { get; set; }

        /// <summary>
        /// 员工姓名
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 工序Id
        /// </summary>
        public string SubId { get; set; }

        /// <summary>
        /// 工序名称
        /// </summary>
        public string SubName { get; set; }

        /// <summary>
        /// 班别Id
        /// </summary>
        public String TeamType { get; set; }

        /// <summary>
        /// 班别名称
        /// </summary>
        public String TeamName { get; set; }

        /// <summary>
        /// 生产日期
        /// </summary>
        public DateTime? WorkDate { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public Double? Price { get; set; }

        /// <summary>
        /// 生产数量
        /// </summary>
        public Double? Nums { get; set; }

        /// <summary>
        /// 总额
        /// </summary>
        public Double? TotalPrice { get; set; }

        /// <summary>
        /// 计算方式：0-计数；1-计重
        /// </summary>
        public Int32? Type { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }
        /// <summary>
        /// 总重
        /// </summary>
        public double? TotalWeight { get; set; }
        /// <summary>
        /// 个人占比
        /// </summary>
        public double? Proportion { get; set; }
        /// <summary>
        /// 总工时
        /// </summary>
        public Double? TotalNum { get; set; }
     
    }

    /// <summary>
    /// 工资(月)
    /// </summary>
    public class PB_UserWagesMonthDTO
    {

        /// <summary>
        /// 序号
        /// </summary>
        public int? Rnumber { get; set; }

        /// <summary>
        /// 工厂Id
        /// </summary>
        public string FactoryId { get; set; }

        /// <summary>
        /// 工厂名称
        /// </summary>
        public string FactoryName { get; set; }

        /// <summary>
        /// 部门Id
        /// </summary>
        public string DeptId { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        public string DeptName { get; set; }

        /// <summary>
        /// 员工Id
        /// </summary>
        public string UserId { get; set; }

        /// <summary>
        /// 员工姓名
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 工序Id
        /// </summary>
        public string SubId { get; set; }

        /// <summary>
        /// 工序名称
        /// </summary>
        public string SubName { get; set; }

        /// <summary>
        /// 生产日期
        /// </summary>
        public DateTime? WorkDate { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public Double? Price { get; set; }

        /// <summary>
        /// 生产数量
        /// </summary>
        public Double? Nums { get; set; }

        /// <summary>
        /// 总额
        /// </summary>
        public Double? TotalPrice { get; set; }

    }

    /// <summary>
    /// 搜索条件
    /// </summary>
    public class WagesConditionDTO
    {
        public string Condition { get; set; }

        public string Keyword { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        public string StartDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        public string EndDate { get; set; }

        /// <summary>
        /// 工序
        /// </summary>
        public string SubId { get; set; }

        /// <summary>
        /// 车间
        /// </summary>
        public string DeptId { get; set; }

        /// <summary>
        /// 班别Id
        /// </summary>
        public string TeamType { get; set; }

        /// <summary>
        /// 当前页
        /// </summary>
        public int pageIndex { get; set; }

        /// <summary>
        /// 每页条数
        /// </summary>
        public int pageRows { get; set; }

        /// <summary>
        /// 排序列
        /// </summary>
        public string SortField { get; set; }

        /// <summary>
        /// 排序方式
        /// </summary>
        public string SortType { get; set; }

        /// <summary>
        /// 类型（1-生产；2-劳务）
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 支付方式（0-日结；1-月结）
        /// </summary>
        public string PayMode { get; set; }
    }

}